import request from "@/utils/request";
export default {
  //添加课程基础信息
  saveCourseInfo(courseInfo) {
    return request({
      url: "/Learning/edu-course/base",
      method: "post",
      data: courseInfo
    });
  },
  // 讲师查询
  selectTeacher() {
    return request({
      url: "/Learning/teacher/teacherAllList",
      method: "get"
    });
  },
  //根据id查询info信息
  getInfoById(courseId) {
    return request({
      url: `/Learning/edu-course/base/${courseId}`,
      method: "get",
      data: "infoById"
    });
  },
  // 根据id查询教师名称
  getTeacherById(courseId) {
    return request({
      url: `/Learning/teacher/getThisTeacher/${courseId}`,
      method: "get",
      data: "teacher"
    });
  },
  // 修改info
  updateInfo(info) {
    return request({
      url: `/Learning/edu-course/updateBase/`,
      method: "post",
      data: info
    });
  },

  // CourseList
  getCourseList(page, pageSize, courseQuery) {
    return request({
      url: `/Learning/edu-course/${page}/${pageSize}`,
      method: "post",
      data: courseQuery //当前端给后端传json时要用到data
    });
  },
  deleCourse(courseId) {
    return request({
      url: `/Learning/edu-course/${courseId}`,
      method: "delete"
    });
  }
};
